home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
8_12.lha
/
8_12
/
tst4.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
670b
|
41 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
include <pat.h>
ain()
pat p(cin);
int x;
float f;
if (p.match("%f %d"))
cout << "match %f %d succeeded\n";
else
cout << "match %f %d failed\n";
p >> f;
cout << "f=" << f << "\n";
if (p.match("%d %f"))
cout << "match %d %f succeeded\n";
else
cout << "match %d %f failed\n";
p >> x;
cout << "x=" << x << "\n";
p >> f;
cout << "f=" << f << "\n";
p >> x;
cout << "x=" << x << "\n";
char c[512];
for (;;)
{
p >> c;
if (!p.good())
break;
cout << c << "\n";
}
return 0;